﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.ServiceBus;
using Microsoft.ServiceBus.Notifications;

namespace SampleApp.Backend
{
	class Program
	{
		static void Main( string[] args )
		{
			var cn = ServiceBusConnectionStringBuilder.CreateUsingSharedAccessSecretWithFullAccess( "NAMESPACE", "FULL ACCESS SECRET" );
			var hubClient = NotificationHubClient.CreateClientFromConnectionString( cn, "sampleapp" );
			hubClient.SendTemplateNotification( new Dictionary<string, string> 
			{ 
				{ "property1", args.Length > 0 ? args[0] : "Hi there!" } 
			}, tag: "my-tag" );

			var notificationBody = WindowsNotificationXmlBuilder.CreateTileSquareText04Xml( "Hi, tile!!" );

			hubClient.SendWindowsNativeNotification( notificationBody.InnerXml, tag: "my-tag" );
		}
	}
}
